package be.rivendale.ghetto;

import be.rivendale.material.Color;
import be.rivendale.mathematics.Point;
import be.rivendale.mathematics.Triple;
import be.rivendale.mathematics.Vector;
import be.rivendale.mathematics.Vertex;

public class Shader {
    public static Color shade(Vertex light, Vector normal, Color color, Point position) {
        Vector lightVector = Triple.vectorBetweenPoints(position, light);
        double angle = lightVector.angle(normal);
        double lightIntensity = angle / Math.PI;
        return light.getColor().multiply(lightIntensity);
    }
}
